Return to start page

Core/Environment/Library Lightning.j

Code

		
1			library ALibraryCoreEnvironmentLightning
2
3 /**
4 * Creates a single lightning which only can be seen by the player "user".
5 * @author Tamino Dauth
6 * @param user Player who can see the lightning.
7 * @param usedCode For furhter information look into the "Splats/LightningData.slk" file of the original Warcraft 3 The Frozen Throne MPQ archives.
8 * @param x0 Start x coordinate.
9 * @param y0 Start y coordinate.
10 * @param z0 Start z coordinate.
11 * @param x1 End x coordinate.
12 * @param y1 End y coordinate.
13 * @param z1 End z coordinate.
14 * @return Returns the created lightning.
15 */
16 function CreateLightningForPlayer takes player user, string usedCode, real x0, real y0, real z0, real x1, real y1, real z1 returns lightning
17 local player localPlayer = GetLocalPlayer()
18 local string localCode = ""
19 if (user == localPlayer) then
20 set localCode = usedCode
21 endif
22 set localPlayer = null
23 return AddLightningEx(localCode, false, x0, y0, z0, x1, y1, z1)
24 endfunction
25
26 endlibrary